-- klei: 我擦,查哈希还要过一遍if判断 
-- reply: 叫叫叫, 单主的需求, 你管着吗
local avatar_id = 'yuemiheng'
local old_HasTag = EntityScript.HasTag
function EntityScript:HasTag(tag,...)
    if tag == 'nosteal' then
        local owner = self.components.inventoryitem and self.components.inventoryitem.owner
        if owner and owner:IsValid() and owner.prefab and owner.prefab == avatar_id then
            return true
        end
    end
    return old_HasTag(self,tag,...)
end


-- 这个不知道有没有用 也拦了

AddComponentPostInit("thief", function(self)
    local old_StealItem = self.StealItem
    function self:StealItem(victim,...)
        if victim and victim.prefab and victim.prefab == 'yuemiheng' then
            return false
        end
        return old_StealItem(self,victim,...)
    end
end)